package org.spider.model;

import org.springframework.util.StringUtils;

public enum DownloadToolEnum {

    /**httpclient请求*/
    HTTPCLIENT,
    /**playwright请求*/
    PLAYWRIGHT,
    /**selenium请求*/
    SELENIUM,
    /**okhttp3请求*/
    OKHTTP3,
    /**appium请求*/
    APPIUM;

    public static DownloadToolEnum match(String name) {
        if (!StringUtils.hasText(name)) {
            return null;
        }
        for (DownloadToolEnum downloadToolEnum : DownloadToolEnum.values()) {
            if (StringUtils.pathEquals(name, downloadToolEnum.name())) {
                return downloadToolEnum;
            }
        }
        return null;
    }
}
